import { ApiProperty } from '@nestjs/swagger';
import { Column, Entity } from 'typeorm';
import { BaseEntity } from '../../../base.entity';

@Entity({ name: 'sys_login_log' })
export default class SysLoginLog extends BaseEntity {


  @Column({ nullable: true, name: 'user_id', comment: '用户id' })
  @ApiProperty()
  userId: string;

  @Column({ nullable: true, comment: '登录IP' })
  @ApiProperty()
  ip: string;

  /* 登录地点 */
  @Column({
    name: 'login_location',
    comment: '登录地点',
    length: 255,
    default: '',
  })
  @ApiProperty()
  loginLocation: string;

  @Column({ type: 'datetime', nullable: true, comment: '登录时间'})
  @ApiProperty()
  time: Date;

  @Column({ length: 500, nullable: true, comment: '浏览器标识' })
  @ApiProperty()
  ua: string;
}
